]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
NetworkMenu: show hardware disabled when rfkill is active
authorGiovanni Campagna <gcampagna@src.gnome.org>
Fri, 2 Dec 2011 20:50:10 +0000 (21:50 +0100)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Wed, 7 Dec 2011 14:36:18 +0000 (15:36 +0100)
When wifi or wwan are blocked by hardware killswitch, we should not
allow changing the switch (it won't work anyway), and show
"hardware disabled" instead, similar to what we already do in the
bluetooth menu.

https://bugzilla.gnome.org/show_bug.cgi?id=665194

js/ui/status/network.js

index fa2b8dfab1fff328fb6eea753336210b33394787..e22cdd8397f9b49610873389ae0940460679aa17 100644 (file)
@@ -249,9 +249,11 @@ const NMWirelessSectionTitleMenuItem = new Lang.Class({
     updateForDevice: function(device) {
         // we show the switch
         // - if there not just one device
-        // - if the switch is off
+        // - if the switch is off (but it can be turned on)
         // - if the device is activated or disconnected
-        if (device && this._softwareEnabled && this._hardwareEnabled) {
+        if (!this._hardwareEnabled) {
+            this.setStatus(_("hardware disabled"));
+        } else if (device && this._softwareEnabled) {
             let text = device.getStatusLabel();
             this.setStatus(text);
         } else